using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace WPFTemplateLib.WpfHelpers
{
	/// <summary>
	/// 渲染帮助类
	/// </summary>
	public static class RenderHelper
	{
		/// <summary>
		/// 获取当前渲染能力等级（RenderCapability.Tier）
		/// </summary>
		/// <returns></returns>
		public static int GetRenderTier()
		{
			return RenderCapability.Tier >> 16;
		}

		/// <summary>
		/// 获取当前渲染能力等级的描述
		/// </summary>
		/// <returns>中文描述</returns>
		public static string GetRenderTierDescription()
		{
			int tier = GetRenderTier();
			switch(tier)
			{
				case 0:
					return "软件渲染（无硬件加速）";
				case 1:
					return "部分硬件加速（DirectX 7.0~8.1）";
				case 2:
					return "完全硬件加速（DirectX 9.0+）";
				default:
					return "未知层级";
			}
		}

		/// <summary>
		/// 获取当前渲染能力等级的描述（英文版）
		/// </summary>
		/// <returns>英文描述</returns>
		public static string GetRenderTierDescriptionEn()
		{
			int tier = GetRenderTier();
			switch(tier)
			{
				case 0:
					return "Software rendering (no hardware acceleration)";
				case 1:
					return "Partial hardware acceleration (DirectX 7.0~8.1)";
				case 2:
					return "Full hardware acceleration (DirectX 9.0+)";
				default:
					return "Unknown tier";
			}
		}
	}
}
